package com.zjp.service.impl;

import com.zjp.mapper.InoculationHistoryMapper;
import com.zjp.mapper.InoculationHistoryMapper2;
import com.zjp.mapper.ReservationMapper;
import com.zjp.pojo.Reservation;
import com.zjp.service.InoculationHistoryService;
import com.zjp.vo.InoculationHistory2;
import com.zjp.vo.ReservationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class InoculationHistoryServiceImpl implements InoculationHistoryService {
    @Autowired
    private InoculationHistoryMapper2 historyMapper2;
    @Autowired
    private InoculationHistoryMapper historyMapper;

    @Autowired
    private ReservationMapper reservationMapper;

    /**
     * 预约接种
     *
     * @return
     */
    public List<ReservationVo> findAllISiteAndVacc(Integer userId) {
        System.out.println("userId" + userId);
        return reservationMapper.selectByPrimaryKey1(userId);
    }

    /**
     * 接种记录表
     *
     * @param
     * @param
     * @return
     */
    public List<InoculationHistory2> findAllInoculationHistory(long userid) {
        return historyMapper2.findAllInoculationHistory(userid);
    }



    /**
     * 查询预约记录
     *
     * @param id
     * @return
     */
    public List<ReservationVo> findReservation(Integer id) {
        return historyMapper.findAllInoculationHistory(id);
    }

    /**
     * 更新预约记录
     *
     * @param
     * @return
     */
    public int updateStuts(Reservation reservationVo) {
        return historyMapper.UpdateStuts(reservationVo);

    }
}


